﻿<Window x:Class="Studio.DocumentDB.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:local="clr-namespace:Studio.DocumentDB"
        WindowStartupLocation="CenterScreen"
        Background="DarkGray"
        Title="DocumentDB Studio" Height="600" Width="800">
    <Window.Resources>
        <Style TargetType="GridSplitter">
            <Setter Property="Background" Value="DarkGoldenrod"/>
            <Setter Property="ShowsPreview" Value="False"/>
        </Style>
    </Window.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*"/>
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <local:ToolBarUserControl Grid.Row="0"/>
        <Grid Grid.Row="1">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="250"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <DockPanel Grid.Column="0" >
                <local:AccountListControl />
            </DockPanel>
            <GridSplitter Grid.Column="0" Grid.RowSpan="2" Width="3" />
            <!--    QueryEditorUserControl   -->
            <DockPanel Grid.Column="1" LastChildFill="True">
                <DockPanel.Style>
                    <Style TargetType="FrameworkElement">
                        <Setter Property="Visibility" Value="Collapsed"/>
                        <Style.Triggers>
                            <DataTrigger Binding="{Binding Path=Accounts.IsCollectionSelected}" Value="true">
                                <Setter Property="Visibility" Value="Visible"/>
                            </DataTrigger>
                        </Style.Triggers>
                    </Style>
                </DockPanel.Style>
                <local:QueryEditorUserControl DataContext="{Binding Accounts.SelectedValue}"/>
            </DockPanel>
            <!--    DocumentViewerUserControl   -->
            <DockPanel Grid.Column="1" LastChildFill="True">
                <DockPanel.Style>
                    <Style TargetType="FrameworkElement">
                        <Setter Property="Visibility" Value="Collapsed"/>
                        <Style.Triggers>
                            <DataTrigger Binding="{Binding Path=Accounts.IsDocumentSelected}" Value="true">
                                <Setter Property="Visibility" Value="Visible"/>
                            </DataTrigger>
                        </Style.Triggers>
                    </Style>
                </DockPanel.Style>
                <local:DocumentViewerUserControl DataContext="{Binding Accounts.SelectedValue}"/>
            </DockPanel>
        </Grid>
        <StatusBar Grid.Row="2" Background="{StaticResource toolBarColour}">
            <StatusBarItem HorizontalAlignment="Right">
                <StackPanel Orientation="Horizontal">
                    <Label>Version </Label>
                    <Label Name="version"/>
                </StackPanel>
            </StatusBarItem>
        </StatusBar>
    </Grid>
</Window>
